#include <iostream>
#include "point.h"
#include "person.h"

using namespace std;
using namespace A;

Point add(Point &p1, Point &p2) {
    Point n;
    n.x = p1.x + p2.x;
    n.y = p1.y + p2.y;
    cout << "add pn: " << &n << endl;
    return n;
}

ostream& operator<<(ostream &o, Point &p) {
    cout << "(" << p.x << ", " << p.y << ")";
    return o;
}

int main(int argc, char **argv) {
    Point p1(1, 2);
    Point p2(2, 3);

//    Point n = add(p1, p2);
//    cout << "main pn: " << &n << endl;
//    n.printInfo();

    Point sum = p1 + p2;
    sum.printInfo();

    Point p3 = ++p1;
    p3.printInfo();
    Point p4 = p2++;
    p4.printInfo();

    cout << "aaa" << endl;

    cout << p3 << endl;
    cout << p4 << endl;

    cout << p3 << p4 << endl;

    const Person per("zhangsan", 10);
//    per = per;
//    Person per2 = per;
//    Person per3 = (per2 = per);

    Person per2 = per;
    Person per3;
    per3 = per;

    per.printInfo();

    return 0;
}